﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="AddDepartment.ascx.cs"
    Inherits="Team4Mock.UserControl.Department.AddDepartment" %>
<style type="text/css">
    .style1
    {
        width: 177px;
    }
    .style2
    {
        width: 151px;
    }
    #txtBusID
    {
        width: 108px;
    }
    #txtContactID
    {
        width: 105px;
    }
</style>
<script type="text/javascript">
    function getContactID() {
        var s = document.getElementById('id').value;
        if (s != "") {
            document.getElementById('<%=idContact.ClientID%>').value = s;
        }

        var b = document.getElementById('idBus').value;
        if (b != "") {
            document.getElementById('<%=hdidBus.ClientID%>').value = b;
        }
        var p = document.getElementById('txtPostCode').value;
        if (p != "") {
            document.getElementById('<%=PostCode.ClientID%>').value = p;
        }
        var t = document.getElementById('txtTown').value;
        if (t != "") {
            document.getElementById('<%=Town.ClientID%>').value = t;
        }
        var c = document.getElementById('txtCounty').value;
        if (c != "") {
            document.getElementById('<%=County.ClientID%>').value = c;
        }
        var sic = document.getElementById('txtSICCode').value;
        if (sic != "") {
            document.getElementById('<%=hdsic.ClientID%>').value = sic;
        }
    }
</script>
<script type="text/javascript">
    $(document).ready(function () {

        $(".tab_content").hide();
        $("ul.tabs li:first").addClass("active").show();
        $(".tab_content:first").show();

        $("ul.tabs li").click(function () {

            $("ul.tabs li").removeClass("active");
            $(this).addClass("active");
            $(".tab_content").hide();

            var activeTab = $(this).find("a").attr("href");
            $(activeTab).slideDown();
            return false;
        });
    });
</script>
<script type="text/javascript">
    function PopupBusiness() {
        window.open("/FormView/PopupBusiness.aspx", 'popUpWindow', 'height=500,width=800,left=300,top=100,resizable=No,scrollbars=No,toolbar=no,menubar=no,location=no,directories=no, status=No');
    }
    function PopupAddress() {
        window.open("/FormView/PopupAddress.aspx", 'popUpWindow', 'height=500,width=800,left=300,top=100,resizable=No,scrollbars=No,toolbar=no,menubar=no,location=no,directories=no, status=No');
    }
    function PopupContact() {
        window.open("/FormView/PopupContact.aspx", 'popUpWindow', 'height=500,width=800,left=300,top=100,resizable=No,scrollbars=No,toolbar=no,menubar=no,location=no,directories=no, status=No');
    }
    function Error() {
        alert("Error in processing !");
        window.location.href = "/FormView/Default.aspx";
    }
</script>
<fieldset style="width: 768px">
    <div style="width: 770px;">
        <ul class="tabs" style="width: 779px; float: left;">
            <li><a href="#Department" class="active tab">Department Details</a></li>
            <li><a href="#Team" class="active tab">Teams</a></li>
        </ul>
        <br />
        <div class="tab_container">
            <div id="Department" class="tab_content">
                <table width="765px" cellpadding="0px" cellspacing="0px" border="0" style="font-size: 15px;">
                    <tr>
                        <td class="style1">
                            Department Name <span style="color: Red;">(*)</span>
                        </td>
                        <td class="style9">
                            <asp:TextBox ID="txtPartName" runat="server" Width="186px"></asp:TextBox>
                        </td>
                        <td class="style2">
                            Type of Business <span style="color: Red;">(*)</span>
                        </td>
                        <td>
                            <input type="text" id="txtBusID" readonly="readonly" />
                            &nbsp;&nbsp;<a href="#" onclick="PopupBusiness();return false;">Lookup</a>
                        </td>
                    </tr>
                    <tr>
                        <td class="style1">
                            Department Short Description
                        </td>
                        <td class="style13">
                            <asp:TextBox ID="txtDesShort" runat="server" TextMode="MultiLine" Height="63px" Width="186px"
                                Style="margin-left: 0px"></asp:TextBox>
                        </td>
                        <td class="style2">
                            SIC Code
                        </td>
                        <td>
                            <input type="text" id="txtSICCode" readonly="readonly" style="width: 176px;">
                            <input type="hidden" id="idBus">
                            <asp:HiddenField ID="hdidBus" runat="server" />
                            <asp:HiddenField ID="hdsic" runat="server" />
                        </td>
                    </tr>
                    <tr>
                        <td class="style1">
                            Lead Contact
                        </td>
                        <td>
                            <input type="text" id="Name" readonly="readonly" style="width: 104px" />
                            <input type="hidden" id="id" />
                            &nbsp;&nbsp; <a href="#" onclick="PopupContact();return false;">Lookup</a>
                            <asp:HiddenField ID="idContact" runat="server" />
                        </td>
                        <td class="style2">
                            BU/Directorate Full Description
                        </td>
                        <td>
                            <asp:TextBox ID="txtDesFull" runat="server" TextMode="MultiLine" Height="63px" Width="177px"
                                Style="margin-left: 0px"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            Copy Address From
                        </td>
                        <td>
                            <asp:RadioButton runat="server" GroupName="copyfrom" ID="rdOrg" Text="Organisation" />
                            <asp:RadioButton runat="server" GroupName="copyfrom" ID="rdParent" Text="Parent" />
                        </td>
                        <td class="style2">
                            Phone Number
                        </td>
                        <td>
                            <asp:TextBox ID="txtPhone" runat="server" Width="180px"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td class="style1">
                            Address Line 1 <span style="color: Red;">(*)</span>
                        </td>
                        <td>
                            <asp:TextBox ID="txtAdd1" runat="server" Width="186px"></asp:TextBox>
                        </td>
                        <td class="style2">
                            Fax
                        </td>
                        <td>
                            <asp:TextBox ID="txtFax" runat="server" Width="180px"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td class="style1">
                            Address Line 2
                        </td>
                        <td>
                            <asp:TextBox ID="txtAdd2" runat="server" Width="186px"></asp:TextBox>
                        </td>
                        <td class="style2">
                            &nbsp;Web Address
                        </td>
                        <td>
                            <asp:TextBox ID="txtWeb" runat="server" Width="180px"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td class="style1">
                            Address Line 3
                        </td>
                        <td>
                            <asp:TextBox ID="txtAdd3" runat="server" Width="186px"></asp:TextBox>
                        </td>
                        <td class="style2">
                            Charity Number
                        </td>
                        <td>
                            <asp:TextBox ID="txtCharNum" runat="server" Width="180px"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td class="style1">
                            Post Code <span style="color: Red;">(*)</span>
                        </td>
                        <td>
                            <input type="text" id="txtPostCode" style="width: 117px;" />
                            &nbsp;&nbsp;<a href="#" onclick="PopupAddress();return false;">Lookup</a>
                            <asp:HiddenField ID="PostCode" runat="server" />
                        </td>
                        <td class="style2">
                            Company Number
                        </td>
                        <td>
                            <asp:TextBox ID="txtComNum" runat="server" Width="180px"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td class="style1">
                            Town/Village/City
                        </td>
                        <td>
                            <input type="text" id="txtTown" style="width: 186px;" />
                            <asp:HiddenField ID="Town" runat="server" />
                        </td>
                        <td class="style2">
                            &nbsp;Nation/Country
                        </td>
                        <td>
                            <asp:DropDownList ID="dlCountry" AutoPostBack="false" DataTextField="CountryName"
                                DataValueField="CountryName" runat="server" Width="186px">
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr>
                        <td class="style1">
                            County
                        </td>
                        <td>
                            <input type="text" id="txtCounty" style="width: 186px;" />
                            <asp:HiddenField ID="County" runat="server" />
                        </td>
                        <td class="style2">
                            Is Active
                        </td>
                        <td>
                            <asp:CheckBox runat="server" ID="ckIsActive" />
                        </td>
                    </tr>
                </table>
                <asp:UpdatePanel ID="Tab1" runat="server">
                    <ContentTemplate>
                        <p style="width: 765px; font-size: 15px; background-color: lavender; line-height: 25px;">
                            <asp:Label ID="tb" runat="server"></asp:Label>
                        </p>
                        <asp:Button ID="btnDel" runat="server" Text="Delete" CssClass="button" OnClick="btnDel_Click" />
                        <asp:Button ID="btnSave" runat="server" Text="Save" CssClass="button" OnClientClick="getContactID()"
                            OnClick="btnSave_Click" />
                        <asp:Button ID="btnBack" runat="server" Text="Back" CssClass="button" OnClick="btnBack_Click" /><br />
                    </ContentTemplate>
                    <Triggers>
                        <asp:AsyncPostBackTrigger ControlID="btnSave" EventName="Click" />
                        <asp:AsyncPostBackTrigger ControlID="btnDel" EventName="Click" />
                    </Triggers>
                </asp:UpdatePanel>
                <asp:UpdateProgress ID="pro" runat="server" AssociatedUpdatePanelID="Tab1">
                </asp:UpdateProgress>
            </div>
        </div>
        <div class="tab_container">
            <div id="Team" class="tab_content" style="font-size: 15px;">
                <div style="width: 509px; float: left; height: 32px; font-size: 15px; line-height: 32px;">
                    <a href="#">All</a>&nbsp;&nbsp;| <a href="#">0-9</a>&nbsp;&nbsp;| <a href="#">A-B-C-D-E</a>&nbsp;&nbsp;|
                    <a href="#">F-G-H-I-J</a>&nbsp;&nbsp;| <a href="#">K-L-M-N</a>&nbsp;&nbsp;| <a href="#">
                        O-P-Q-R</a>&nbsp;&nbsp;| <a href="#">S-T-U-V</a>&nbsp;&nbsp;| <a href="#">W-X-Y-Z</a>
                </div>
                <div style="float: left; height: 32px; line-height: 32px;">
                    <asp:Button ID="btnCreate" runat="server" Text="Create" CssClass="button" OnClick="btnCreate_Click" />&nbsp;&nbsp;
                    <asp:CheckBox ID="CheckBox1" runat="server" Text="In-active" />
                </div>
                <div style="width: 784px;">
                    <asp:GridView ID="gvTeam" AutoGenerateColumns="False" DataKeyNames="ID" runat="server"
                        Width="709px" Font-Size="15px" BackColor="White" BorderColor="#CCCCCC" AllowSorting="true"
                        BorderStyle="None" BorderWidth="1px" CellPadding="3">
                        <Columns>
                            <asp:TemplateField HeaderText="ID" Visible="false">
                                <ItemTemplate>
                                    <asp:Label ID="lbID" runat="server" Text='<%#Eval("ID") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Team Name">
                                <ItemTemplate>
                                    <asp:HyperLink ID="OrgName" NavigateUrl='<%#"/FormView/Team.aspx?"+"t="+Eval("ID")+"&D="+Request.QueryString["D"]+"&ID="+Request.QueryString["ID"]+"&s="+Request.QueryString["s"] %>'
                                        runat="server" Text='<%#Eval("TeamName") %>'></asp:HyperLink>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Head Office Address Line 1">
                                <ItemTemplate>
                                    <asp:Label ID="lbHOA" runat="server" Text='<%#Eval("Address") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Post Code">
                                <ItemTemplate>
                                    <asp:Label ID="lbPostcode" runat="server" Text='<%#Eval("Postcode") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Contact">
                                <ItemTemplate>
                                    <asp:Label ID="lbContact" runat="server" Text='<%#Eval("Contact") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Is Active">
                                <ItemTemplate>
                                    <asp:Label ID="lbActive" runat="server" Text='<%#Eval("IsActive") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                        <FooterStyle BackColor="White" ForeColor="#000066" />
                        <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
                        <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
                        <RowStyle ForeColor="#000066" />
                        <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
                    </asp:GridView>
                </div>
            </div>
        </div>
    </div>
</fieldset>
